<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.org/ui" xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
<h:body>
	<ui:composition template="template.xhtml">

		<ui:define name="title">mehmet emmy</ui:define>
		<ui:define name="body" >

			<h:form id="yazilimAramaListelemeForm" >
				<c:choose>
					<c:when test="${AygitYazilimlariBean.selectedAygitYzl != null}">
						<c:choose>
							<c:when test="#{SirketprofilBean.selectedSirket != null}">
								<p:commandButton id="getAllListButton"
									value="Firma Seçimini Kaldır"
									actionListener="#{AygitYazilimlariBean.restart}"
									update=":yazilimAramaListelemeForm" />

								<p:commandButton id="urunListButton"
									value="Şirket Yazılım Listesine Git"
									actionListener="#{AygitYazilimlariBean.deleteSelectedAygitYzl}"
									update=":yazilimAramaListelemeForm" />
							</c:when>
							<c:otherwise>
								<p:commandButton id="urunListButton"
									value="Yazılım Listesine Git"
									actionListener="#{AygitYazilimlariBean.restart}"
									update=":yazilimAramaListelemeForm" />
							</c:otherwise>
						</c:choose>
						<p:panel header="Yazılım Detayları">  
        					<h:panelGrid columns="2" id="grid">
        						<h:outputLabel value="Firma : " for="firmaAd" style="width:100px;"/>  
            					<h:outputLabel id="firmaAd"   
                            			value="#{AygitYazilimlariBean.selectedAygitYzl.sirketprofil.firmaAd}"/>
                            	<h:outputLabel />
                            	<p:separator style="width:100%; color:red;" />
                            	
                            	<h:outputLabel value="Marka-Model : " for="markaModel" style="width:100px;"/>  
            					<h:outputLabel id="markaModel"   
                            		value="#{AygitYazilimlariBean.selectedAygitYzl.aygit.marka} - 
                            			#{AygitYazilimlariBean.selectedAygitYzl.aygit.model}"/>
                            	<h:outputLabel />
                            	<p:separator style="width:100%;" />
                            	
                            	<h:outputLabel value="Tarih : " for="tarih" style="width:100px;"/>  
            					<h:outputLabel id="tarih"   
                            			value="#{AygitYazilimlariBean.selectedAygitYzl.uploadTarihi}"/>
                            	<h:outputLabel />
                            	<p:separator style="width:100%;" />
                            	
                            	<h:outputLabel value="Versiyon : " for="versiyon" style="width:100px;"/>  
            					<h:outputLabel id="versiyon"   
                            			value="#{AygitYazilimlariBean.selectedAygitYzl.versiyonNo}"/>
                            	<h:outputLabel />
                            	<p:separator style="width:100%;" />
                            	
                            	<h:outputLabel value="Açıklama : " for="aciklama" style="width:100px;"/>  
            					<h:outputLabel id="aciklama"   
                            			value="#{AygitYazilimlariBean.selectedAygitYzl.aciklama}"/>
                            	<h:outputLabel />
                            	<p:separator style="width:100%;" />
                            	
                            	<h:outputLabel />
                            	<a href="#{AygitYazilimlariBean.selectedAygitYzl.diskKonumu}"> Download </a> 
    							
        					</h:panelGrid>
        				</p:panel>
					</c:when>
					<c:otherwise>
						
						<p:dataTable id="yzlAramaTable" var="yazilim"
							value="#{AygitYazilimlariBean.aygitYazilimList}"
							widgetVar="yazilimlarTable" resizableColumns="true"
							emptyMessage="No software found with given criteria"
							rowKey="#{yazilim.aygitYazid}"
							selection="#{AygitYazilimlariBean.selectedAygitYzl}"
							selectionMode="single" paginator="true" rows="10"
							liveScroll="true" >

							<p:ajax event="rowSelect"
								update=":yazilimAramaListelemeForm" />

							<f:facet name="header">
								<c:if test="#{SirketprofilBean.selectedSirket != null}">
             						<p:commandButton id="iptalButon" value="Firma Seçimini Kaldır"
									action="#{AygitYazilimlariBean.restart}" icon="ui-icon-close"
									update=":yazilimAramaListelemeForm" />
								</c:if>
							</f:facet>
							
							<f:facet name="header">
								<p:outputPanel>
									<h:outputText value="Search all fields:" />
									<p:inputText id="globalFilter"
										onkeyup="yazilimlarTable.filter()" style="width:150px" />
								</p:outputPanel>
							</f:facet>

							<p:column id="firmaAdColumn"
								filterBy="#{yazilim.sirketprofil.firmaAd}" headerText="Firma"
								footerText="contains" filterMatchMode="contains">
								<h:outputText value="#{yazilim.sirketprofil.firmaAd}" />
							</p:column>
						 	<p:column id="aygtTurColumn" filterBy="#{yazilim.aygit.marka} - #{yazilim.aygit.model}" headerText="Marka-Model"
								footerText="contains" filterMatchMode="contains">
								<h:outputText id="marka-model"
									value="#{yazilim.aygit.marka} - #{yazilim.aygit.model}" />
							</p:column>
						 
							<p:column id="upTarihColumn" filterBy="#{yazilim.uploadTarihi}"
								headerText="Upload Tarihi" footerText="contains"
								filterMatchMode="contains">
								<h:outputText value="#{yazilim.uploadTarihi}" />
							</p:column>

							<p:column id="versiyonColumn" filterBy="#{yazilim.versiyonNo}"
								headerText="Versiyon" footerText="contains"
								filterMatchMode="contains">
								<h:outputText value="#{yazilim.versiyonNo}" />
							</p:column>
							<f:facet name="footer">
								<p:commandButton id="refreshButton" value="Refresh"
									icon="ui-icon ui-icon-arrowrefresh-1-w"
									actionListener="#{AygitYazilimlariBean.restart}"
									update=":yazilimAramaListelemeForm" />
							</f:facet>
						</p:dataTable>

					</c:otherwise>
				</c:choose>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>